/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.univalle.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Jhony
 */
@Entity
@Table(name = "codeudor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Codeudor.findAll", query = "SELECT c FROM Codeudor c"),
    @NamedQuery(name = "Codeudor.findByCedulaCodeudor", query = "SELECT c FROM Codeudor c WHERE c.cedulaCodeudor = :cedulaCodeudor"),
    @NamedQuery(name = "Codeudor.findByNombreCodeudor", query = "SELECT c FROM Codeudor c WHERE c.nombreCodeudor = :nombreCodeudor"),
    @NamedQuery(name = "Codeudor.findByApellidoCodeudor", query = "SELECT c FROM Codeudor c WHERE c.apellidoCodeudor = :apellidoCodeudor"),
    @NamedQuery(name = "Codeudor.findByDireccionCodeudor", query = "SELECT c FROM Codeudor c WHERE c.direccionCodeudor = :direccionCodeudor"),
    @NamedQuery(name = "Codeudor.findByTelefonoCodeudor", query = "SELECT c FROM Codeudor c WHERE c.telefonoCodeudor = :telefonoCodeudor")})
public class Codeudor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cedula_codeudor")
    private Long cedulaCodeudor;
    @Size(max = 2147483647)
    @Column(name = "nombre_codeudor")
    private String nombreCodeudor;
    @Size(max = 2147483647)
    @Column(name = "apellido_codeudor")
    private String apellidoCodeudor;
    @Size(max = 2147483647)
    @Column(name = "direccion_codeudor")
    private String direccionCodeudor;
    @Size(max = 2147483647)
    @Column(name = "telefono_codeudor")
    private String telefonoCodeudor;
    @OneToMany(mappedBy = "cedulaCodeudor")
    private List<Arrendamientos> arrendamientosList;

    public Codeudor() {
    }

    public Codeudor(Long cedulaCodeudor) {
        this.cedulaCodeudor = cedulaCodeudor;
    }

    public Long getCedulaCodeudor() {
        return cedulaCodeudor;
    }

    public void setCedulaCodeudor(Long cedulaCodeudor) {
        this.cedulaCodeudor = cedulaCodeudor;
    }

    public String getNombreCodeudor() {
        return nombreCodeudor;
    }

    public void setNombreCodeudor(String nombreCodeudor) {
        this.nombreCodeudor = nombreCodeudor;
    }

    public String getApellidoCodeudor() {
        return apellidoCodeudor;
    }

    public void setApellidoCodeudor(String apellidoCodeudor) {
        this.apellidoCodeudor = apellidoCodeudor;
    }

    public String getDireccionCodeudor() {
        return direccionCodeudor;
    }

    public void setDireccionCodeudor(String direccionCodeudor) {
        this.direccionCodeudor = direccionCodeudor;
    }

    public String getTelefonoCodeudor() {
        return telefonoCodeudor;
    }

    public void setTelefonoCodeudor(String telefonoCodeudor) {
        this.telefonoCodeudor = telefonoCodeudor;
    }

    @XmlTransient
    public List<Arrendamientos> getArrendamientosList() {
        return arrendamientosList;
    }

    public void setArrendamientosList(List<Arrendamientos> arrendamientosList) {
        this.arrendamientosList = arrendamientosList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cedulaCodeudor != null ? cedulaCodeudor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Codeudor)) {
            return false;
        }
        Codeudor other = (Codeudor) object;
        if ((this.cedulaCodeudor == null && other.cedulaCodeudor != null) || (this.cedulaCodeudor != null && !this.cedulaCodeudor.equals(other.cedulaCodeudor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.edu.univalle.modelo.Codeudor[ cedulaCodeudor=" + cedulaCodeudor + " ]";
    }
    
}
